/**
 * 
 */
package com.yidu.erp.service.BeyondModel;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yidu.erp.dao.BeyondModelMapper;
import com.yidu.erp.model.BeyondModel;

/**
 * 功能模块service实现类
 * @author wws
 * @date  2017年11月7日
 */
@Service
public class ModelServiceImpl implements ModelService{

	@Resource
	private BeyondModelMapper beyondModelMapper ;
	
	@Override
	public List<BeyondModel> selectAll(Map<String, Object> map) {
		System.out.println("map==="+map);
		return beyondModelMapper.selectAll(map);
	}

	@Override
	public int deleteByPrimaryKey(String modelId) {
		
		return beyondModelMapper.deleteByPrimaryKey(modelId);
	}

	
	@Override
	public int insertSelective(BeyondModel record) {
		
		return beyondModelMapper.insertSelective(record);
	}

	
	@Override
	public int updateByPrimaryKeySelective(BeyondModel record) {
		
		return beyondModelMapper.updateByPrimaryKeySelective(record);
	}

	
	@Override
	public BeyondModel selectByPrimaryKey(String modelId) {
		
		return beyondModelMapper.selectByPrimaryKey(modelId);
	}

	
	@Override
	public List<BeyondModel> showmodelAll() {
		
		return beyondModelMapper.showmodelAll();
	}

	
	@Override
	public BeyondModel getSumidselectModel(String modelSumid) {
		
		return beyondModelMapper.getSumidselectModel(modelSumid);
	}

	
	@Override
	public String selectModelName(String modelId) {
		
		return beyondModelMapper.selectModelName(modelId);
	}

	
	@Override
	public String selectModelIdone(String name) {
	
		return beyondModelMapper.selectModelIdone(name);
	}

	
	@Override
	public List<BeyondModel> selectSonModel(String id) {
		
		return beyondModelMapper.selectSonModel(id);
	}

	@Override
	public List<BeyondModel> showIndex(String staffId) {
		//一级分类
		List<BeyondModel> list = beyondModelMapper.showIndex(staffId);
		//二级分类
		List<BeyondModel> listTow = beyondModelMapper.showIndexTwo(staffId);
		
		for(BeyondModel model : list){
			for(BeyondModel obj : listTow){
				if(model.getModelId().equals(obj.getModelSumid())){
					model.getModelList().add(obj);
				}
			}
		}
		return list;
	}

	
	@Override
	public List<BeyondModel> getAllmodel(Map<String, Object> map) {
		
		return beyondModelMapper.getAllmodel(map);
	}

	
	@Override
	public int findAllRowCount(Map<String, Object> map) {
		
		return beyondModelMapper.findAllRowCount(map);
	}

	
	@Override
	public List<BeyondModel> showmodeloneId() {
		
		return beyondModelMapper.showmodeloneId();
	}

	
	@Override
	public List<BeyondModel> getztreemodule() {
		
		return beyondModelMapper.getztreemodule();
	}

	
	@Override
	public BeyondModel bySumidselectModel(String modelId) {
		
		return beyondModelMapper.bySumidselectModel(modelId);
	}

	
	@Override
	public int delete(String modelId) {
		
		return beyondModelMapper.delete(modelId);
	}
	

}
